<div class="modal fade" id="login" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">请填写普通用户登录信息</h4>
</div>
<div class="modal-body">
<form name="fm" method="post" action="doLogin.php" onsubmit="return check()"
class="form-horizontal">

<?php
// show.php 页面传来的登录链接，需要带着 vid 参数，以便登陆成功后直接返回视频内容页
?>
<input type="hidden" name="vid" id="videoid" >
<div class="form-group">
<label for="exampleInputUserName1" class="col-md-2 control-label">用户名</label>
<div class="col-md-4">
<input type="text" name="username" class="form-control" id="exampleInputUserName1"
placeholder="姓名" required>
</div>
<div class="col-md-6">
</div>
</div>
<div class="form-group">
<label for="exampleInputPassword1" class="col-md-2 control-label">密码</label>
<div class="col-md-4">
<input type="password" name="pswd" class="form-control" id="exampleInputPassword1"
placeholder="密码" required>
</div>
<div class="col-md-6">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input type="submit" class="btn btn-default" value="登录">
<input type="reset" class="btn btn-default" value="重置">
</div>
</div>
<?php
if(isset($_GET["msg"])){
echo'<h1 style="color:red;">'.$_GET["msg"]."</h1>";
}
224
?>
<?php
if(isset($_GET["msg9"])){
echo'<h1 style="color:red;">'.$_GET["msg9"]."</h1>";
}
?>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" onclick="location.replace('index.php')"
data-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>



<div class="modal fade" id="changePassword" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">修改个人密码</h4>
</div>
<div class="modal-body">
<form name="fm" method="post" action="doChangePassword.php" onsubmit="return
check()" class="form-horizontal">
<div class="form-group">
<label for="exampleInputPassword1" class="col-md-4 control-label">原密码</label>
<div class="col-md-4">
<input type="password" name="old" class="form-control" id="exampleInputPassword1"
placeholder="原密码" required>
</div>
<div class="col-md-4">
</div>
</div>
<div class="form-group">
<label for="exampleInputPassword1" class="col-md-4 control-label">新密码</label>
<div class="col-md-4">
<input type="password" name="new1" class="form-control" id="exampleInputPassword1" placeholder="新密码" required>
</div>
<div class="col-md-4">
</div>
</div>
<div class="form-group">
<label for="exampleInputPassword1" class="col-md-4 control-label"> 确 认 新 密 码
</label>
<div class="col-md-4">
<input type="password" name="new2" class="form-control" id="exampleInputPassword1"
placeholder="确认新密码" required>
</div>
<div class="col-md-4">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input type="submit" class="btn btn-default" value="修改">
<input type="reset" class="btn btn-default" value="重置">
</div>
</div>
<?php
if(isset($_GET["msg3"])){
echo'<h1 style="color:red;">'.$_GET["msg3"]."</h1>";
}
?>
<?php
if(isset($_GET["msg4"])){
echo'<h1 style="color:red;">'.$_GET["msg4"]."</h1>";
}
?>
<?php
if(isset($_GET["msg5"])){

echo'<h1 style="color:red;">'.$_GET["msg5"]."</h1>";
}
?>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" onclick="location.replace('logout.php')"
data-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>

<!-- 注册用户信息 -->

<div class="modal fade" id="reg" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">请填写用户注册信息</h4>
      </div>
      <div class="modal-body">

 <form method=post action="doReg.php" enctype="multipart/form-data"  class="form-horizontal">

  <div class="form-group">
  <label for="exampleInputUserName" class="col-md-2 control-label">姓名</label>
 <div class="col-md-8">
<input type="text" name="username" class="form-control" id="exampleInputUserName" placeholder="姓名" required>
</div>
</div>

 <div class="form-group">
  <label for="exampleInputPassword" class="col-md-2 control-label">密码</label>
 <div class="col-md-8">
<input type="password" name="password" class="form-control" id="exampleInputPassword" placeholder="密码" required>
</div>
</div>
 
   <div class="form-group">
  <label class="col-md-2 control-label">性别</label>
    <div class="col-md-8">
    <label class="radio-inline">
  <input type="radio" name="gender"  value=0 checked> 男
</label>
<label class="radio-inline">
  <input type="radio" name="gender" value=1> 女
</label>
   </div>
  </div>

<div class="form-group">
  <label for="exampleInputBirth" class="col-md-2 control-label">生日</label>
 <div class="col-md-8">
<input type="date" name="birthdate" class="form-control" id="exampleInputBirth" placeholder="生日" required>
</div>
</div>
 
  <div class="form-group">
      <label  class="col-md-2 control-label">爱好</label>
    <div class="col-md-8">
     <label class="checkbox-inline">
  <input type="checkbox"  name="hobby[]" value="旅游"> 旅游
</label>
<label class="checkbox-inline">
  <input type="checkbox" name="hobby[]" value="登山"> 登山
</label>
<label class="checkbox-inline">
  <input type="checkbox" name="hobby[]"  value="健身"> 健身
</label>
<label class="checkbox-inline">
  <input type="checkbox" name="hobby[]"  value="上网"> 上网
</label>
<label class="checkbox-inline">
  <input type="checkbox"  name="hobby[]" value="游泳"> 游泳
</label>
    </div>
  </div>

<div class="form-group">
<label  class="col-md-2 control-label">学历</label>
<div class="col-md-8">
<select  class="form-control" name="degree">
  <option value="0">请选择</option>
    <option value="1">高中</option> 
    <option value="2">大学</option>
  <option value="3">研究生</option>  
  <option value="4">博士生</option>
</select>
</div>
  </div>

  <div class="form-group">
    <label for="exampleInputTextarea1" class="col-md-2 control-label">自我介绍</label>
    <div class="col-md-8">
  <textarea class="form-control" rows="3"  id="exampleInputTextarea1" placeholder="自我简介：" name="intro"></textarea>
  </div>
  </div>

  <div class="form-group">
    <label for="exampleInputFile" class="col-md-2 control-label">头像</label>
    <div class="col-md-8">
  <input type="file"  name="pic" id="exampleInputFile" required>
    </div>
  </div>
  
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-8">
      <input type="submit" class="btn btn-default" value="提交">
    <input type="reset" class="btn btn-default" value="重置">
    </div> 
     </div>
<?php
if(isset($_GET["msg1"])){
echo'<h3 style="color:red;">'.$_GET["msg1"]."</h3>";
}
?>
<?php
if(isset($_GET["msg2"])){
echo'<h3 style="color:red;">'.$_GET["msg2"]."</h3>";
}
?>

<?php
if(isset($_GET["msg7"])){
echo'<h3 style="color:red;">'.$_GET["msg7"]."</h3>";
}
?>
</form>
   </div>
      <div class="modal-footer">
              <button type="button" class="btn btn-default" onclick="location.replace('index.php')" data-dismiss="modal">关闭</button>
      </div>
    </div>
  </div>
</div>  











<!-- 修改个人信息 -->


 <?php  


 require_once('inc_user.php');
  connect();
 //validate();
session_start();
$u=$_SESSION["user"];
  //编写sql语句
  
 $sql="select * from users where uname='$u'";
   // echo $sql.'<br/>';
  $result=mysql_query($sql) or die('查询失败！'.mysql_error());
  $row=mysql_fetch_assoc($result);
  $uname=$row['uname'];
    $gender=$row['gender'];
    $birthdate=$row['birthdate'];
    $hobby=$row['hobby'];
    $degree=$row['degree'];
    $intro=$row['intro'];
     // $pic=$row['pic'];
   $pic=UserPhotoPath.$row['pic'];

?>
<div class="modal fade" id="changeInfor" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">请修改个人信息</h4>
</div>
<div class="modal-body">
<form name="fm" method="post" action="doChangeInfor.php" enctype="multipart/form-data"  class="form-horizontal" onsubmit="return check()">

  <div class="form-group ">
     <label class="col-md-2 col-xs-5 control-label">用户名:</label>
     <div class="col-md-4">
     <input type="text" name="uname" class="form-control" placeholder="姓名" disabled="disabled" value=<?php echo $uname; ?> > 
     </div>
  </div>

  <div class="form-group ">
     <label class="col-md-2 control-label">性别:</label>
     <div class="col-md-4">
     <label class="radio-inline">
     <input type="radio" name="gender" value="0" <?php  if(!$gender) echo 'checked';  ?>>男 </label>
     <label class="radio-inline">
     <input type="radio" name="gender" value="1" <?php  if($gender) echo 'checked';  ?>>女</label>
     </div>
  </div>

  <div class="form-group ">
     <label class="col-md-2 control-label">生日:</label>
     <div class="col-md-4">
     <input type="date" name="birthdate" class="form-control" placeholder="生日" value=<?php echo $birthdate; ?> required=""> 
     </div>
  </div>

  <div class="form-group ">
     <label class="col-md-2 control-label">爱好:</label>
     <div class="col-md-4">
     <label class="checkbox-inline">
     <input type="checkbox" name="hobby[]" value="旅游" <?php  if(strstr($hobby,'旅游')) echo 'checked';  ?>>旅游</label>
     
     <label class="checkbox-inline">
     <input type="checkbox" name="hobby[]" value="登山" <?php  if(strstr($hobby,'登山')) echo 'checked';  ?>>登山</label>
     
     <label class="checkbox-inline">
     <input type="checkbox" name="hobby[]" value="健身" <?php  if(strstr($hobby,'健身')) echo 'checked';  ?>>健身</label>
     <label class="checkbox-inline">
     <input type="checkbox" name="hobby[]" value="上网" <?php  if(strstr($hobby,'上网')) echo 'checked';  ?>>上网</label>
     <label class="checkbox-inline">
     <input type="checkbox" name="hobby[]" value="游泳" <?php  if(strstr($hobby,'游泳')) echo 'checked';  ?>>游泳</label>
     </div>
  </div>
 
  <div class="form-group ">
     <label class="col-md-2 control-label">学历:</label>
     <div class="col-md-4">
     <select name="degree">
  <option value="0">---请选择---</option>
  <option value="1" <?php  if($degree=='1') echo 'selected';  ?>>高中</option>
  <option value="2" <?php  if($degree=='2') echo 'selected';  ?>>大学</option>
  <option value="3" <?php  if($degree=='3') echo 'selected';  ?>>研究生</option>
  <option value="4" <?php  if($degree=='4') echo 'selected';  ?>>博士生</option>
      </select>
     </div>
  </div>

  <div class="form-group ">
     <label for="exampleInputTextareal" class="col-md-2 control-label">自我介绍</label>
     <div class="col-md-4">
     <textarea class="form-control" rows="3" id="exampleInputTextareal" placeholder="自我介绍" name="intro"><?php  echo $intro;  ?> </textarea> 
     </div>
  </div>

  <div class="form-group ">
     <label for="exampleInputFile" class="col-md-2 control-label">头像</label>
     <div class="col-md-4">
     <input type="file" name="pic" id="exampleInputFile" required=""> 
     </div>
  </div>
  <div class="form-group ">
     <label for="exampleInputFile" class="col-md-3 control-label">原头像</label>
     <div class="col-md-5">
    <img  class="img-circle" src='<?php  echo $pic;  ?>' width=60 height=60 alt="无头像">
     </div>
  </div>
  
 <!-- width=100 height=150 -->

  <div class="form-group ">
     <div class="col-sm-offset-2 col-sm-10">
     <input type="submit" class="btn btn-default" value="更新"> 
     
     </div>
  </div>

<?php
if(isset($_GET["msg6"])){
echo'<h1 style="color:red;">'.$_GET["msg6"]."</h1>";
}
?>

<?php
if(isset($_GET["msg8"])){
echo'<h1 style="color:red;">'.$_GET["msg8"]."</h1>";
}
?>
<?php
if(isset($_GET["msg10"])){
echo'<h1 style="color:red;">'.$_GET["msg10"]."</h1>";
}
?>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" onclick="location.replace('index.php')"
data-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>